#include "mainwindow.h"
#include "../resources/forms/ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent) :
        CFramelessWindow(parent), ui(new Ui::MainWindow) {
    ui->setupUi(this);
#ifdef Q_OS_WIN
    //feel free to change this number to see how it works
    setResizeableAreaWidth(8);
    //set titlebar widget, wo we can drag MainWindow by it
    setTitleBar(ui->widgetTitlebar);
    //add labelTitleText to ignore list, so we can drag MainWindow by it too
    addIgnoreWidget(ui->labelTitleText);
#endif
//    ui->labelMargins->setText(currentMargins());
}

MainWindow::~MainWindow() {
    delete ui;
}


void MainWindow::on_btnMin_clicked()
{
    qDebug() << "最小化...";
    showMinimized();
}
void MainWindow::on_btnMax_clicked()
{
    qDebug() << "最大化...";
    if (isMaximized()) showNormal();
    else showMaximized();
}
void MainWindow::on_btnClose_clicked()
{
    qDebug() << "关闭...";
    close();
}

void MainWindow::on_bthFull_clicked()
{
    qDebug() << "全屏...";
    if (isFullScreen()) showNormal();
    else showFullScreen();
}







